05. Installing the Constraint Layout Library
Installing the Constraint Layout Library
To continue building the Boarding Pass app, you'll need to make sure you have the latest Constraint Layout library. To ensure you have the latest Constraint Layout library:
- Click Tools > Android > SDK Manager.
- Click the SDK Tools tab.
- Expand Support Repository and then check ConstraintLayout for Android and Solver for ConstraintLayout. Check Show Package Details and take note of the version you're downloading (you'll need this below).
- Click OK.
- Add the
ConstraintLayoutlibrary as a dependency in your module-levelbuild.gradlefile:
gradle dependencies { compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' } - The library version you download may be higher, so be sure the value you specify here matches the version from step 3.
- In the toolbar or sync notification, click Sync Project with Gradle Files.
- Now you're ready to build your layout with
ConstraintLayout.
BoardingPass Code
In this lesson, we will work on building out a BoardPass app which helps users get information about their flight such as which terminal, gate number, and seat number.
The code for this app can be found in the Lesson11-Completeing-The-UI folder of the Toy App Repository.
If you need to a refresher on how the code is organized, please refer the concept where we introduced the code flow.
Explanation of BoardingPass App
Throughout this lesson, you will get to design this layout of a boarding pass app from scratch using Constraint Layouts and Data Binding, you will also get to add important accessibility and localization attributes in the app to cater for a wide diversity of potential users.